]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Make st_button_fake_release() work with touch press
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 10 Nov 2017 17:29:53 +0000 (18:29 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 5 Feb 2018 16:46:57 +0000 (17:46 +0100)
The st_button_release() call wouldn't happen because StButton does not
set priv->button_mask on touch events. And if we make it called, we can't
try to unset the device grab at the end of the function, as device/sequence
are unset earlier on.

src/st/st-button.c

index 38fe20759f7765db9a1c881b5cafc4f81db37e21..8f5c4922f86f737d86f0e616b87b34531778682c 100644 (file)
@@ -765,7 +765,13 @@ st_button_fake_release (StButton *button)
   g_return_if_fail (ST_IS_BUTTON (button));
 
   priv = st_button_get_instance_private (button);
-  if (priv->pressed)
+  if (priv->device && priv->press_sequence)
+    {
+      clutter_input_device_sequence_ungrab (priv->device,
+                                            priv->press_sequence);
+    }
+
+  if (priv->pressed || priv->press_sequence)
     st_button_release (button, priv->device,
                        priv->pressed, 0, NULL);
 
@@ -775,14 +781,6 @@ st_button_fake_release (StButton *button)
       clutter_ungrab_pointer ();
     }
 
-  if (priv->device &&
-      priv->press_sequence)
-    {
-      clutter_input_device_sequence_ungrab (priv->device,
-                                            priv->press_sequence);
-      priv->press_sequence = NULL;
-    }
-
   priv->device = NULL;
 }